package model;

/**
 * Represents a natural number by wrapping an {@code int}.
 * 
 * @author Henrik Wall
 * @author Rudolf Schmidt
 * @author Eugen Nemirowski
 */
public final class Nat extends Int {
	/**
	 * Constructor for {@link Nat}.
	 * 
	 * @param value
	 *            the wrapped {@code int}
	 */
	private Nat(int value) {
		super(value);
	}

	/**
	 * Creates a {@link Nat}.
	 * 
	 * @param value
	 *            the wrapped {@code int}
	 * @return a {@link Nat}.
	 * @throws IllegalArgumentException
	 *             if {@code value} is negative
	 */
	public static Nat create(int value) {
		if (value < 0) {
			throw new IllegalArgumentException();
		}
		return new Nat(value);
	}
}
